package com.example.smartcity.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.fragment.app.FragmentStatePagerAdapter;

import com.example.smartcity.bean.NewsClassifyBean;

import java.util.ArrayList;

public class MyFragmentApt extends FragmentStatePagerAdapter {

    private NewsClassifyBean data;
    private ArrayList<Fragment> fragments;

    public MyFragmentApt(@NonNull FragmentManager fm, NewsClassifyBean data, ArrayList<Fragment> fragments) {
        super(fm);
        this.data = data;
        this.fragments = fragments;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return data.getData().size();
    }




}
